package com.xkdx.guangguang.fragment.city;

import java.util.HashMap;

import android.content.Context;

import com.xkdx.caipiao.HomePageActivity;
import com.xkdx.guangguang.fragment.BaseFragment;
import com.xkdx.guangguang.module.network.AbsModule;
import com.xkdx.guangguang.module.network.HttpTask;
import com.xkdx.guangguang.module.network.JsonHttpRequest;

public class CityPresistence extends HttpTask {

	public CityPresistence(BaseFragment baseFragment) {
		this.baseFragment = baseFragment;
		this.connectTimeout = 3000;
		this.soTimeOut = 3000;
		requestInstent = new JsonHttpRequest();
	}
	
	public CityPresistence(Context context){
		this.context = context;
		this.connectTimeout = 3000;
		this.soTimeOut = 3000;
		requestInstent = new JsonHttpRequest();
	}

	@Override
	protected void onPostExecute(HashMap<String, AbsModule> result) {
		if (baseFragment != null) {
			baseFragment.showLoaded(result);
		}else if(context != null){
			if(context instanceof HomePageActivity){
				((HomePageActivity)context).refreshCityInfo(result);
			}
		}
	}
}
